package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 数据备份任务表
 *
 * @author zhiyuan
 * @since 2023-09-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_data_task")
@Schema(name = "EduDataTask", title = "数据备份任务表", description = "数据备份任务表实体类")
public class EduDataTask extends Model<EduDataTask> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "taskId", description = "任务id")
    @TableId(value = "task_id", type = IdType.ASSIGN_ID)
    private String taskId;

    @Schema(name = "taskName", description = "记录名")
    @TableField(value = "task_name")
    private String taskName;

    @Schema(name = "year", description = "年度")
    @TableField(value = "year")
    private Integer year;

    @Schema(name = "status", description = "任务状态 0待处理 1待迁移 2待加密 3待销毁 4完成")
    @TableField(value = "status")
    private String status;

    @Schema(name = "errorFlag", description = "处理状态是否有误  0是  1否")
    @TableField(value = "error_flag")
    private String errorFlag;

    @Schema(name = "errorRemarks", description = "错误描述")
    @TableField(value = "error_remarks")
    private String errorRemarks;

    @Schema(name = "del", description = "0,未删除,1,已删除")
    @TableField(value = "del", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    @TableLogic
    private String del;

    @Schema(name = "createName", description = "创建人")
    @TableField(value = "create_name", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private String createName;

    @Schema(name = "createTime", description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NOT_NULL)
    private Date createTime;

    @Schema(name = "updateName", description = "修改人")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private String updateName;

    @Schema(name = "updateTime", description = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @Override
    public Serializable pkVal() {
        return this.taskId;
    }
}
